<?php
header("Content-type:text/html; charset=utf-8");
require_once ('config.php');
require_once (WEBURL.'/include/conn.php');
require_once ('login_status_check.php');
if(!checkLogin()){
	require_once ('admin_login.php');
}
class Admin{
	private $admin_info;
	function __construct(){
		$this->admin_info=array();
	}

    function getAdminInfoByAdminId($admin_id){
    	$this->admin_info=array();
    	$sql_get_admin_info="select admin_name,admin_type_id,admin_true_name,email from admin where admin_id=$admin_id;";
    	$result_get_admin_info=mysql_query($sql_get_admin_info) or die(mysql_error());
    	$nums=mysql_numrows($result_get_admin_info);
    	if($nums!=0){
    		    $data=mysql_fetch_row($result_get_admin_info);
    			$this->admin_info['admin_name']=$data[0];
    			$this->admin_info['admin_type_id']=$data[1];
    			$this->admin_info['admin_true_name']=$data[2];
    			$this->admin_info['email']=$data[3];
    		}
    		return $this->admin_info;
    	
    	}
    function getAdminInfoByAdminLoginName(){
    	$this->admin_info=array();
    	$admin_name=$_SESSION['admin_name'];
    	$sql_get_admin_info="select admin_id,admin_type_id,admin_true_name,email from admin where admin_name='$admin_name';";
    	$result_get_admin_info=mysql_query($sql_get_admin_info) or die(mysql_error());
    	$nums=mysql_numrows($result_get_admin_info);
    	if($nums!=0){
    		$data=mysql_fetch_row($result_get_admin_info);
    		
    		$this->admin_info['admin_id']=$data[0];
    		$this->admin_info['admin_name']=$admin_name;
    		$this->admin_info['admin_type_id']=$data[1];
    		$this->admin_info['admin_true_name']=$data[2];
    		$this->admin_info['email']=$data[3];
    	}
    	return $this->admin_info;
    	 
    	}

}